<?php
//get the id of the shopping cart
$shoppingcart_id = $_COOKIE["shoppingcart_id"];

//count the number of different items contained in the shopping cart
$count = mysql_query("SELECT COUNT(*) AS ITEMS FROM rel WHERE ID_CART = '$shoppingcart_id'");
$item_nr = mysql_fetch_array($count);

//print the result to screen
echo("Your cart contains ".$item_nr["ITEMS"]." items");
?>